<template>
  <manage-page
    ref="tableName"
    :addButton="addButton"
    :autoQuery="autoQuery"
    :basePath="basePath"
    :buttonList="buttonList"
    :conditionLayout="conditionLayout"
    :copyButton="copyButton"
    :customTable="customTable"
    :customerQueryFunction="customerQueryFunction"
    :defaultConditionParam="defaultConditionParam"
    :defaultQueryParam="defaultQueryParam"
    :deleteButton="deleteButton"
    :disableButton="disableButton"
    :doubleClickModify="doubleClickModify"
    :leftButton1="leftButton1"
    :leftButton2="leftButton2"
    :leftButton3="leftButton3"
    :leftButton4="leftButton4"
    :manageCondition="manageCondition"
    :manageExport="manageExport"
    :manageImport="manageImport"
    :manageRefresh="manageRefresh"
    :modifyButton="modifyButton"
    :multiSelect="multiSelect"
    :rightButton1="rightButton1"
    :rightButton2="rightButton2"
    :rightButton3="rightButton3"
    :rightButton4="rightButton4"
    :rightButton5="rightButton5"
    @handleCurrentChange="handleCurrentChange"
    @handleQueryData="handleQueryData"
    @handleSelectionChange="handleSelectionChange"
  />
</template>

<script>

import managePage from '@/components/ManagePage'

const demoButton = {
  show: true,
  disabled: true,
  type: 'primary',
  name: '按键示例',
  icon: '',
  function: (data) => {
    console.log(data)
  }
}
export default {
  name: 'store',
  data() {
    return {
      // 选择条件部分一行显示个数
      conditionLayout: 2,
      // 是否自动查询
      autoQuery: false,
      // 基础url
      basePath: '',
      // 默认查询url参数
      defaultQueryParam: {},
      // 默认查询条件
      defaultConditionParam: [],
      // 自定义查询函数
      customerQueryFunction: '',
      // 配置查询条件按钮是否显示
      manageCondition: false,
      // 刷新按钮是否显示
      manageRefresh: false,
      // 添加按钮配置
      addButton: undefined,
      // 复制按钮配置
      copyButton: undefined,
      // 删除按钮配置
      deleteButton: undefined,
      // 软删除按钮配置
      disableButton: undefined,
      // 修改按钮配置
      modifyButton: undefined,
      // 双击表格是否进入编辑模式
      doubleClickModify: false,
      // 是否支持导入
      manageImport: false,
      // 是否支持导出
      manageExport: false,
      // 自定义上排按钮
      leftButton1: undefined,
      leftButton2: undefined,
      leftButton3: undefined,
      leftButton4: undefined,
      rightButton1: undefined,
      rightButton2: undefined,
      rightButton3: undefined,
      rightButton4: undefined,
      rightButton5: undefined,
      // 是否支持多选
      multiSelect: false,
      customTable: false,
      buttonList: [demoButton],
      currentRow: null
    }
  },
  components: {
    managePage
  },
  methods: {
    handleCurrentChange(current, old) {
      this.currentRow = current
      // console.log(this.currentRow)
    },
    handleQueryData(data) {
      this.currentRow = null
    },
    handleSelectionChange(selectedData) {

    }
  },
  watch: {
    currentRow: {
      handler(newValue, oldValue) {

      },
      deep: true
    }
  }
}
</script>
